(*导弹追踪问题*)

Manipulate[
 Module[{t = t0, p1, p2, d, od, v2},(*v2 是追击点的恒定速度*)
  p1 = {t, Sin@t + 2};
  v2 = 0.5;
  od = VectorAngle[p1, p2];
  
  p2 = {v2*t, 1};
  
  d = EuclideanDistance[p1, p2];
  
  Graphics[{
    PointSize[0.02], Pink, Point[p1],
    PointSize[0.02], Blue, Point[p2],
    Text["两点距离:" <> ToString[d~SetPrecision~2], {7, 4}, {-1, 1}],
    Text["两点水平夹角:" <> ToString[Cos@od~SetPrecision~2], {7, 3}, {-1, 1}]
    }, Axes -> True, PlotRange -> {{0, 12}, {-1, 4}}]
  ], {t0, 0.1, 10}
 ]
